﻿//***************************************************************
//说明：自动生成代码第二版
//时间：2014-10-31 11:40
//***************************************************************
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Collections;
using GS.DataBase;

namespace LandWeb.Models
{
    /// <summary>
    /// 表[LANDFLOWGLOB]存取
    /// 关键字段为[ID0]
    /// </summary>
    public class LANDFLOWGLOB : GS.IGSAccess<LANDFLOWGLOB>
    {
        /// <summary>
		/// 字段名称:ID0 [字段类型:int]
		/// </summary>
  		public string ID0{get;set;}

		/// <summary>
		/// 字段名称:案件编号 [字段类型:varchar]
		/// </summary>
  		public string AnJianBianHao{get;set;}

		/// <summary>
		/// 字段名称:案件名称 [字段类型:varchar]
		/// </summary>
  		public string AnJianMingCheng{get;set;}

		/// <summary>
		/// 字段名称:流程ID [字段类型:int]
		/// </summary>
  		public string LiuChengID{get;set;}

		/// <summary>
		/// 字段名称:活动ID [字段类型:int]
		/// </summary>
  		public string HuoDongID{get;set;}

		/// <summary>
		/// 字段名称:承办人ID [字段类型:int]
		/// </summary>
  		public string ChengBanRenID{get;set;}

		/// <summary>
		/// 字段名称:承办意见 [字段类型:varchar]
		/// </summary>
  		public string ChengBanYiJian{get;set;}

		/// <summary>
		/// 字段名称:承办时间 [字段类型:datetime]
		/// </summary>
  		public string ChengBanShiJian{get;set;}

		/// <summary>
		/// 字段名称:延迟时间 [字段类型:decimal]
		/// </summary>
  		public string YanChiShiJian{get;set;}

		/// <summary>
		/// 字段名称:流水号 [字段类型:int]
		/// </summary>
  		public string LiuShuiHao{get;set;}

		/// <summary>
		/// 字段名称:备注 [字段类型:varchar]
		/// </summary>
  		public string BeiZhu{get;set;}

		/// <summary>
		/// 字段名称:历史标志 [字段类型:int]
		/// </summary>
  		public string LiShiBiaoZhi{get;set;}

		/// <summary>
		/// 字段名称:现状标志 [字段类型:int]
		/// </summary>
  		public string XianZhuangBiaoZhi{get;set;}

		/// <summary>
		/// 字段名称:案件状态 [字段类型:varchar]
		/// </summary>
  		public string AnJianZhuangTai{get;set;}

		/// <summary>
		/// 字段名称:已办事件 [字段类型:varchar]
		/// </summary>
  		public string YiBanShiJian{get;set;}

		/// <summary>
		/// 字段名称:保留字段1 [字段类型:varchar]
		/// </summary>
  		public string BaoLiuZiDuan1{get;set;}

		/// <summary>
		/// 字段名称:保留字段2 [字段类型:varchar]
		/// </summary>
  		public string BaoLiuZiDuan2{get;set;}

		/// <summary>
		/// 字段名称:母流程入口ID0 [字段类型:int]
		/// </summary>
  		public string MuLiuChengRuKouID0{get;set;}

		/// <summary>
		/// 字段名称:主承办人 [字段类型:int]
		/// </summary>
  		public string ZhuChengBanRen{get;set;}

		/// <summary>
		/// 字段名称:工作所花时间 [字段类型:varchar]
		/// </summary>
  		public string GongZuoSuoHuaShiJian{get;set;}

		/// <summary>
		/// 字段名称:PRESTEP [字段类型:int]
		/// </summary>
  		public string PRESTEP{get;set;}

		/// <summary>
		/// 字段名称:STATES [字段类型:int]
		/// </summary>
  		public string STATES{get;set;}

		/// <summary>
		/// 字段名称:IP [字段类型:varchar]
		/// </summary>
  		public string IP{get;set;}

		/// <summary>
		/// 字段名称:督办ID [字段类型:int]
		/// </summary>
  		public string DuBanID{get;set;}

		/// <summary>
		/// 字段名称:移交方向 [字段类型:int]
		/// </summary>
  		public string YiJiaoFangXiang{get;set;}

		/// <summary>
		/// 字段名称:分组ID [字段类型:int]
		/// </summary>
  		public string FenZuID{get;set;}

		/// <summary>
		/// 字段名称:时限 [字段类型:float]
		/// </summary>
  		public string ShiXian{get;set;}

		/// <summary>
		/// 字段名称:办结时间 [字段类型:datetime]
		/// </summary>
  		public string BanJieShiJian{get;set;}

		/// <summary>
		/// 字段名称:会办标志 [字段类型:int]
		/// </summary>
  		public string HuiBanBiaoZhi{get;set;}

		/// <summary>
		/// 字段名称:决定异常 [字段类型:int]
		/// </summary>
  		public string JueDingYiChang{get;set;}

		/// <summary>
		/// 字段名称:收费异常 [字段类型:int]
		/// </summary>
  		public string ShouFeiYiChang{get;set;}

		/// <summary>
		/// 字段名称:DECIDEINFO [字段类型:varchar]
		/// </summary>
  		public string DECIDEINFO{get;set;}



        /// <summary>
        /// 数据库字段名称
        /// </summary>
        public class Column
        {
            /// <summary>
			/// 字段名称:ID0 [字段类型:int]
			/// </summary>
  			public const string ID0="ID0";

			/// <summary>
			/// 字段名称:案件编号 [字段类型:varchar]
			/// </summary>
  			public const string AnJianBianHao="案件编号";

			/// <summary>
			/// 字段名称:案件名称 [字段类型:varchar]
			/// </summary>
  			public const string AnJianMingCheng="案件名称";

			/// <summary>
			/// 字段名称:流程ID [字段类型:int]
			/// </summary>
  			public const string LiuChengID="流程ID";

			/// <summary>
			/// 字段名称:活动ID [字段类型:int]
			/// </summary>
  			public const string HuoDongID="活动ID";

			/// <summary>
			/// 字段名称:承办人ID [字段类型:int]
			/// </summary>
  			public const string ChengBanRenID="承办人ID";

			/// <summary>
			/// 字段名称:承办意见 [字段类型:varchar]
			/// </summary>
  			public const string ChengBanYiJian="承办意见";

			/// <summary>
			/// 字段名称:承办时间 [字段类型:datetime]
			/// </summary>
  			public const string ChengBanShiJian="承办时间";

			/// <summary>
			/// 字段名称:延迟时间 [字段类型:decimal]
			/// </summary>
  			public const string YanChiShiJian="延迟时间";

			/// <summary>
			/// 字段名称:流水号 [字段类型:int]
			/// </summary>
  			public const string LiuShuiHao="流水号";

			/// <summary>
			/// 字段名称:备注 [字段类型:varchar]
			/// </summary>
  			public const string BeiZhu="备注";

			/// <summary>
			/// 字段名称:历史标志 [字段类型:int]
			/// </summary>
  			public const string LiShiBiaoZhi="历史标志";

			/// <summary>
			/// 字段名称:现状标志 [字段类型:int]
			/// </summary>
  			public const string XianZhuangBiaoZhi="现状标志";

			/// <summary>
			/// 字段名称:案件状态 [字段类型:varchar]
			/// </summary>
  			public const string AnJianZhuangTai="案件状态";

			/// <summary>
			/// 字段名称:已办事件 [字段类型:varchar]
			/// </summary>
  			public const string YiBanShiJian="已办事件";

			/// <summary>
			/// 字段名称:保留字段1 [字段类型:varchar]
			/// </summary>
  			public const string BaoLiuZiDuan1="保留字段1";

			/// <summary>
			/// 字段名称:保留字段2 [字段类型:varchar]
			/// </summary>
  			public const string BaoLiuZiDuan2="保留字段2";

			/// <summary>
			/// 字段名称:母流程入口ID0 [字段类型:int]
			/// </summary>
  			public const string MuLiuChengRuKouID0="母流程入口ID0";

			/// <summary>
			/// 字段名称:主承办人 [字段类型:int]
			/// </summary>
  			public const string ZhuChengBanRen="主承办人";

			/// <summary>
			/// 字段名称:工作所花时间 [字段类型:varchar]
			/// </summary>
  			public const string GongZuoSuoHuaShiJian="工作所花时间";

			/// <summary>
			/// 字段名称:PRESTEP [字段类型:int]
			/// </summary>
  			public const string PRESTEP="PRESTEP";

			/// <summary>
			/// 字段名称:STATES [字段类型:int]
			/// </summary>
  			public const string STATES="STATES";

			/// <summary>
			/// 字段名称:IP [字段类型:varchar]
			/// </summary>
  			public const string IP="IP";

			/// <summary>
			/// 字段名称:督办ID [字段类型:int]
			/// </summary>
  			public const string DuBanID="督办ID";

			/// <summary>
			/// 字段名称:移交方向 [字段类型:int]
			/// </summary>
  			public const string YiJiaoFangXiang="移交方向";

			/// <summary>
			/// 字段名称:分组ID [字段类型:int]
			/// </summary>
  			public const string FenZuID="分组ID";

			/// <summary>
			/// 字段名称:时限 [字段类型:float]
			/// </summary>
  			public const string ShiXian="时限";

			/// <summary>
			/// 字段名称:办结时间 [字段类型:datetime]
			/// </summary>
  			public const string BanJieShiJian="办结时间";

			/// <summary>
			/// 字段名称:会办标志 [字段类型:int]
			/// </summary>
  			public const string HuiBanBiaoZhi="会办标志";

			/// <summary>
			/// 字段名称:决定异常 [字段类型:int]
			/// </summary>
  			public const string JueDingYiChang="决定异常";

			/// <summary>
			/// 字段名称:收费异常 [字段类型:int]
			/// </summary>
  			public const string ShouFeiYiChang="收费异常";

			/// <summary>
			/// 字段名称:DECIDEINFO [字段类型:varchar]
			/// </summary>
  			public const string DECIDEINFO="DECIDEINFO";


        }
            
        /// <summary>
        /// 获取一行记录
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sFilter">条件字符串，以AND开头，不能为空</param>
        /// <returns></returns>
        public LANDFLOWGLOB Get(IDbAccess iDb, string sFilter)
        {
            if (string.IsNullOrWhiteSpace(sFilter))
            {
                throw new Exception("条件字符串不能为空");
            }
            LANDFLOWGLOB result = new LANDFLOWGLOB();
            DataSet ds = iDb.GetDataSet("SELECT ID0,案件编号,案件名称,流程ID,活动ID,承办人ID,承办意见,承办时间,延迟时间,流水号,备注,历史标志,现状标志,案件状态,已办事件,保留字段1,保留字段2,母流程入口ID0,主承办人,工作所花时间,PRESTEP,STATES,IP,督办ID,移交方向,分组ID,时限,办结时间,会办标志,决定异常,收费异常,DECIDEINFO FROM LANDFLOWGLOB WHERE 1=1 "+ sFilter);
            if (ds.Tables[0].Rows.Count == 1)
            {
                result.ID0 = ds.Tables[0].Rows[0][Column.ID0].ToString();
				result.AnJianBianHao = ds.Tables[0].Rows[0][Column.AnJianBianHao].ToString();
				result.AnJianMingCheng = ds.Tables[0].Rows[0][Column.AnJianMingCheng].ToString();
				result.LiuChengID = ds.Tables[0].Rows[0][Column.LiuChengID].ToString();
				result.HuoDongID = ds.Tables[0].Rows[0][Column.HuoDongID].ToString();
				result.ChengBanRenID = ds.Tables[0].Rows[0][Column.ChengBanRenID].ToString();
				result.ChengBanYiJian = ds.Tables[0].Rows[0][Column.ChengBanYiJian].ToString();
				result.ChengBanShiJian = ds.Tables[0].Rows[0][Column.ChengBanShiJian].ToString();
				result.YanChiShiJian = ds.Tables[0].Rows[0][Column.YanChiShiJian].ToString();
				result.LiuShuiHao = ds.Tables[0].Rows[0][Column.LiuShuiHao].ToString();
				result.BeiZhu = ds.Tables[0].Rows[0][Column.BeiZhu].ToString();
				result.LiShiBiaoZhi = ds.Tables[0].Rows[0][Column.LiShiBiaoZhi].ToString();
				result.XianZhuangBiaoZhi = ds.Tables[0].Rows[0][Column.XianZhuangBiaoZhi].ToString();
				result.AnJianZhuangTai = ds.Tables[0].Rows[0][Column.AnJianZhuangTai].ToString();
				result.YiBanShiJian = ds.Tables[0].Rows[0][Column.YiBanShiJian].ToString();
				result.BaoLiuZiDuan1 = ds.Tables[0].Rows[0][Column.BaoLiuZiDuan1].ToString();
				result.BaoLiuZiDuan2 = ds.Tables[0].Rows[0][Column.BaoLiuZiDuan2].ToString();
				result.MuLiuChengRuKouID0 = ds.Tables[0].Rows[0][Column.MuLiuChengRuKouID0].ToString();
				result.ZhuChengBanRen = ds.Tables[0].Rows[0][Column.ZhuChengBanRen].ToString();
				result.GongZuoSuoHuaShiJian = ds.Tables[0].Rows[0][Column.GongZuoSuoHuaShiJian].ToString();
				result.PRESTEP = ds.Tables[0].Rows[0][Column.PRESTEP].ToString();
				result.STATES = ds.Tables[0].Rows[0][Column.STATES].ToString();
				result.IP = ds.Tables[0].Rows[0][Column.IP].ToString();
				result.DuBanID = ds.Tables[0].Rows[0][Column.DuBanID].ToString();
				result.YiJiaoFangXiang = ds.Tables[0].Rows[0][Column.YiJiaoFangXiang].ToString();
				result.FenZuID = ds.Tables[0].Rows[0][Column.FenZuID].ToString();
				result.ShiXian = ds.Tables[0].Rows[0][Column.ShiXian].ToString();
				result.BanJieShiJian = ds.Tables[0].Rows[0][Column.BanJieShiJian].ToString();
				result.HuiBanBiaoZhi = ds.Tables[0].Rows[0][Column.HuiBanBiaoZhi].ToString();
				result.JueDingYiChang = ds.Tables[0].Rows[0][Column.JueDingYiChang].ToString();
				result.ShouFeiYiChang = ds.Tables[0].Rows[0][Column.ShouFeiYiChang].ToString();
				result.DECIDEINFO = ds.Tables[0].Rows[0][Column.DECIDEINFO].ToString();

                return result;
            }				
            return null;
        }
            
        /// <summary>
        /// 插入新记录
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="result">表对象</param>
        /// <returns>保存是否成功</returns>
        public bool Add(IDbAccess iDb, LANDFLOWGLOB result)
        {
            if (string.IsNullOrWhiteSpace(result.ID0.ToString()))
            {
                throw new Exception("关键字的值不能为空");
            }

            Hashtable ht = new Hashtable();
            ht.Add(Column.ID0,result.ID0);
			ht.Add(Column.AnJianBianHao,result.AnJianBianHao);
			ht.Add(Column.AnJianMingCheng,result.AnJianMingCheng);
			ht.Add(Column.LiuChengID,result.LiuChengID);
			ht.Add(Column.HuoDongID,result.HuoDongID);
			ht.Add(Column.ChengBanRenID,result.ChengBanRenID);
			ht.Add(Column.ChengBanYiJian,result.ChengBanYiJian);
			ht.Add(Column.ChengBanShiJian,result.ChengBanShiJian);
			ht.Add(Column.YanChiShiJian,result.YanChiShiJian);
			ht.Add(Column.LiuShuiHao,result.LiuShuiHao);
			ht.Add(Column.BeiZhu,result.BeiZhu);
			ht.Add(Column.LiShiBiaoZhi,result.LiShiBiaoZhi);
			ht.Add(Column.XianZhuangBiaoZhi,result.XianZhuangBiaoZhi);
			ht.Add(Column.AnJianZhuangTai,result.AnJianZhuangTai);
			ht.Add(Column.YiBanShiJian,result.YiBanShiJian);
			ht.Add(Column.BaoLiuZiDuan1,result.BaoLiuZiDuan1);
			ht.Add(Column.BaoLiuZiDuan2,result.BaoLiuZiDuan2);
			ht.Add(Column.MuLiuChengRuKouID0,result.MuLiuChengRuKouID0);
			ht.Add(Column.ZhuChengBanRen,result.ZhuChengBanRen);
			ht.Add(Column.GongZuoSuoHuaShiJian,result.GongZuoSuoHuaShiJian);
			ht.Add(Column.PRESTEP,result.PRESTEP);
			ht.Add(Column.STATES,result.STATES);
			ht.Add(Column.IP,result.IP);
			ht.Add(Column.DuBanID,result.DuBanID);
			ht.Add(Column.YiJiaoFangXiang,result.YiJiaoFangXiang);
			ht.Add(Column.FenZuID,result.FenZuID);
			ht.Add(Column.ShiXian,result.ShiXian);
			ht.Add(Column.BanJieShiJian,result.BanJieShiJian);
			ht.Add(Column.HuiBanBiaoZhi,result.HuiBanBiaoZhi);
			ht.Add(Column.JueDingYiChang,result.JueDingYiChang);
			ht.Add(Column.ShouFeiYiChang,result.ShouFeiYiChang);
			ht.Add(Column.DECIDEINFO,result.DECIDEINFO);

            return iDb.AddData("LANDFLOWGLOB", ht);
        }
            
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="result">表对象</param>
        /// <returns>保存是否成功</returns>
        public bool Save(IDbAccess iDb, LANDFLOWGLOB result)
        {
            if (string.IsNullOrWhiteSpace(result.ID0.ToString()))
            {
                throw new Exception("关键字的值不能为空");
            }
                
            Hashtable ht = new Hashtable();
            ht.Add(Column.ID0,result.ID0);
			ht.Add(Column.AnJianBianHao,result.AnJianBianHao);
			ht.Add(Column.AnJianMingCheng,result.AnJianMingCheng);
			ht.Add(Column.LiuChengID,result.LiuChengID);
			ht.Add(Column.HuoDongID,result.HuoDongID);
			ht.Add(Column.ChengBanRenID,result.ChengBanRenID);
			ht.Add(Column.ChengBanYiJian,result.ChengBanYiJian);
			ht.Add(Column.ChengBanShiJian,result.ChengBanShiJian);
			ht.Add(Column.YanChiShiJian,result.YanChiShiJian);
			ht.Add(Column.LiuShuiHao,result.LiuShuiHao);
			ht.Add(Column.BeiZhu,result.BeiZhu);
			ht.Add(Column.LiShiBiaoZhi,result.LiShiBiaoZhi);
			ht.Add(Column.XianZhuangBiaoZhi,result.XianZhuangBiaoZhi);
			ht.Add(Column.AnJianZhuangTai,result.AnJianZhuangTai);
			ht.Add(Column.YiBanShiJian,result.YiBanShiJian);
			ht.Add(Column.BaoLiuZiDuan1,result.BaoLiuZiDuan1);
			ht.Add(Column.BaoLiuZiDuan2,result.BaoLiuZiDuan2);
			ht.Add(Column.MuLiuChengRuKouID0,result.MuLiuChengRuKouID0);
			ht.Add(Column.ZhuChengBanRen,result.ZhuChengBanRen);
			ht.Add(Column.GongZuoSuoHuaShiJian,result.GongZuoSuoHuaShiJian);
			ht.Add(Column.PRESTEP,result.PRESTEP);
			ht.Add(Column.STATES,result.STATES);
			ht.Add(Column.IP,result.IP);
			ht.Add(Column.DuBanID,result.DuBanID);
			ht.Add(Column.YiJiaoFangXiang,result.YiJiaoFangXiang);
			ht.Add(Column.FenZuID,result.FenZuID);
			ht.Add(Column.ShiXian,result.ShiXian);
			ht.Add(Column.BanJieShiJian,result.BanJieShiJian);
			ht.Add(Column.HuiBanBiaoZhi,result.HuiBanBiaoZhi);
			ht.Add(Column.JueDingYiChang,result.JueDingYiChang);
			ht.Add(Column.ShouFeiYiChang,result.ShouFeiYiChang);
			ht.Add(Column.DECIDEINFO,result.DECIDEINFO);

            return iDb.SaveData("LANDFLOWGLOB", ht, "ID0");
        }
            
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sFilter">条件字符串，以AND开头，不能为空</param>
        /// <returns>返回删除的记录行数</returns>
        public int Delete(IDbAccess iDb, string sFilter)
        {
            if (string.IsNullOrWhiteSpace(sFilter))
            {
                throw new Exception("条件字符串不能为空");
            }
            return iDb.DeleteTableRow("LANDFLOWGLOB"," 1=1 "+ sFilter);
        }
            
        /// <summary>
        /// 获得指定过滤条件的记录行数
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sFilter">查询条件，以AND开头,可以为空</param>
        /// <returns>数据库中的记录行数</returns>
        public int GetDataCount(IDbAccess iDb,string sFilter)
        {
            string strSql = "select count(*) from LANDFLOWGLOB where 1=1 " + sFilter;
            return Convert.ToInt32(iDb.GetFirstColumn(strSql));
        }
            
        /// <summary>
        /// 返回全部数据List
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sFilter">查询条件，以AND开头,可以为空</param>
        /// <param name="sOrderColumn">排序字段，可以指定多个字段，以','分隔</param>
        /// <param name="sOrderType">排序类型 ASC/DESC</param>
        /// <returns>返回全部数据List</returns>
        public List<LANDFLOWGLOB> SearchList(IDbAccess iDb,string sFilter,string sOrderColumn,string sOrderType)
        {
            return SearchListByPage(iDb, "ID0", 0, 0, sFilter, sOrderColumn, sOrderType).ListResult;
        }
            
        /// <summary>
        /// 返回分页数据List
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sKey">表关键字</param>
        /// <param name="iPageSize">单页记录行数</param>
        /// <param name="iPageIndex">分页索引</param>
        /// <param name="sFilter">查询条件，以AND开头,可以为空</param>
        /// <param name="sOrderColumn">排序字段，可以指定多个字段，以','分隔</param>
        /// <param name="sOrderType">排序类型 ASC/DESC</param>
        /// <returns>返回分页数据List</returns>
        public SearchListResult<LANDFLOWGLOB> SearchListByPage(IDbAccess iDb, string sKey, int iPageSize, int iPageIndex, string sFilter, string sOrderColumn, string sOrderType)
        {
            SearchListResult<LANDFLOWGLOB> slr = new SearchListResult<LANDFLOWGLOB>();
            slr.Count =  GetDataCount(iDb,sFilter);
            string sOrderString = "";
            if (sOrderColumn != "")
            {
                sOrderString = " ORDER BY "+sOrderColumn;
                if (sOrderType.ToLower() == "desc")
                {
                    sOrderString += " DESC ";
                }
                else
                {
                    sOrderString += " ASC ";
                }
            }
            sFilter = " 1=1 " + sFilter;
            string strSql = "SELECT ID0,案件编号,案件名称,流程ID,活动ID,承办人ID,承办意见,承办时间,延迟时间,流水号,备注,历史标志,现状标志,案件状态,已办事件,保留字段1,保留字段2,母流程入口ID0,主承办人,工作所花时间,PRESTEP,STATES,IP,督办ID,移交方向,分组ID,时限,办结时间,会办标志,决定异常,收费异常,DECIDEINFO FROM LANDFLOWGLOB t WHERE " + sFilter + sOrderString;
            if (iPageSize > 0)
            {
                strSql = iDb.GetSqlForPageSize("LANDFLOWGLOB", "ID0", iPageSize, iPageIndex, sFilter, sOrderString);
            }
            DataSet ds = iDb.GetDataSet(strSql);
            List<LANDFLOWGLOB> list = new List<LANDFLOWGLOB>();
            for (int ii = 0; ii < ds.Tables[0].Rows.Count; ii++)
            {
                LANDFLOWGLOB result = new LANDFLOWGLOB();
                result.ID0 = ds.Tables[0].Rows[ii][Column.ID0].ToString();
				result.AnJianBianHao = ds.Tables[0].Rows[ii][Column.AnJianBianHao].ToString();
				result.AnJianMingCheng = ds.Tables[0].Rows[ii][Column.AnJianMingCheng].ToString();
				result.LiuChengID = ds.Tables[0].Rows[ii][Column.LiuChengID].ToString();
				result.HuoDongID = ds.Tables[0].Rows[ii][Column.HuoDongID].ToString();
				result.ChengBanRenID = ds.Tables[0].Rows[ii][Column.ChengBanRenID].ToString();
				result.ChengBanYiJian = ds.Tables[0].Rows[ii][Column.ChengBanYiJian].ToString();
				result.ChengBanShiJian = ds.Tables[0].Rows[ii][Column.ChengBanShiJian].ToString();
				result.YanChiShiJian = ds.Tables[0].Rows[ii][Column.YanChiShiJian].ToString();
				result.LiuShuiHao = ds.Tables[0].Rows[ii][Column.LiuShuiHao].ToString();
				result.BeiZhu = ds.Tables[0].Rows[ii][Column.BeiZhu].ToString();
				result.LiShiBiaoZhi = ds.Tables[0].Rows[ii][Column.LiShiBiaoZhi].ToString();
				result.XianZhuangBiaoZhi = ds.Tables[0].Rows[ii][Column.XianZhuangBiaoZhi].ToString();
				result.AnJianZhuangTai = ds.Tables[0].Rows[ii][Column.AnJianZhuangTai].ToString();
				result.YiBanShiJian = ds.Tables[0].Rows[ii][Column.YiBanShiJian].ToString();
				result.BaoLiuZiDuan1 = ds.Tables[0].Rows[ii][Column.BaoLiuZiDuan1].ToString();
				result.BaoLiuZiDuan2 = ds.Tables[0].Rows[ii][Column.BaoLiuZiDuan2].ToString();
				result.MuLiuChengRuKouID0 = ds.Tables[0].Rows[ii][Column.MuLiuChengRuKouID0].ToString();
				result.ZhuChengBanRen = ds.Tables[0].Rows[ii][Column.ZhuChengBanRen].ToString();
				result.GongZuoSuoHuaShiJian = ds.Tables[0].Rows[ii][Column.GongZuoSuoHuaShiJian].ToString();
				result.PRESTEP = ds.Tables[0].Rows[ii][Column.PRESTEP].ToString();
				result.STATES = ds.Tables[0].Rows[ii][Column.STATES].ToString();
				result.IP = ds.Tables[0].Rows[ii][Column.IP].ToString();
				result.DuBanID = ds.Tables[0].Rows[ii][Column.DuBanID].ToString();
				result.YiJiaoFangXiang = ds.Tables[0].Rows[ii][Column.YiJiaoFangXiang].ToString();
				result.FenZuID = ds.Tables[0].Rows[ii][Column.FenZuID].ToString();
				result.ShiXian = ds.Tables[0].Rows[ii][Column.ShiXian].ToString();
				result.BanJieShiJian = ds.Tables[0].Rows[ii][Column.BanJieShiJian].ToString();
				result.HuiBanBiaoZhi = ds.Tables[0].Rows[ii][Column.HuiBanBiaoZhi].ToString();
				result.JueDingYiChang = ds.Tables[0].Rows[ii][Column.JueDingYiChang].ToString();
				result.ShouFeiYiChang = ds.Tables[0].Rows[ii][Column.ShouFeiYiChang].ToString();
				result.DECIDEINFO = ds.Tables[0].Rows[ii][Column.DECIDEINFO].ToString();

                list.Add(result);
            }
            slr.ListResult = list;
            return slr;
        }
            
        /// <summary>
        /// 返回全部数据DataSet
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sFilter">查询条件，以AND开头,可以为空</param>
        /// <param name="sOrderColumn">排序字段，可以指定多个字段，以','分隔</param>
        /// <param name="sOrderType">排序类型 ASC/DESC</param>
        /// <returns>返回全部数据DataSet</returns>
        public DataSet Search(IDbAccess iDb,string sFilter,string sOrderColumn,string sOrderType)
        {
            string sOrderString = "";
            if (sOrderColumn != "")
            {
                sOrderString = " ORDER BY "+sOrderColumn;
                if (sOrderType.ToLower() == "desc")
                {
                    sOrderString += " DESC ";
                }
                else
                {
                    sOrderString += " ASC ";
                }
            }
            sFilter = " 1=1 " + sFilter;
            string strSql = "SELECT ID0,案件编号,案件名称,流程ID,活动ID,承办人ID,承办意见,承办时间,延迟时间,流水号,备注,历史标志,现状标志,案件状态,已办事件,保留字段1,保留字段2,母流程入口ID0,主承办人,工作所花时间,PRESTEP,STATES,IP,督办ID,移交方向,分组ID,时限,办结时间,会办标志,决定异常,收费异常,DECIDEINFO FROM LANDFLOWGLOB t WHERE " + sFilter + sOrderString;
            DataSet ds = iDb.GetDataSet(strSql);
            return ds;
        }
            
        /// <summary>
        /// 返回分页数据DataSet
        /// </summary>
        /// <param name="iDb">数据库对象</param>
        /// <param name="sKey">表关键字</param>
        /// <param name="iPageSize">单页记录行数</param>
        /// <param name="iPageIndex">分页索引</param>
        /// <param name="sFilter">查询条件，以AND开头,可以为空</param>
        /// <param name="sOrderColumn">排序字段，可以指定多个字段，以','分隔</param>
        /// <param name="sOrderType">排序类型 ASC/DESC</param>
        /// <returns>返回分页数据DataSet</returns>
        public SearchResult SearchByPage(IDbAccess iDb, string sKey, int iPageSize, int iPageIndex, string sFilter, string sOrderColumn, string sOrderType)
        {
            SearchResult sr = new SearchResult();
            sr.Count = GetDataCount(iDb,sFilter);
            string sOrderString = "";
            if (sOrderColumn != "")
            {
                sOrderString = " ORDER BY "+sOrderColumn;
                if (sOrderType.ToLower() == "desc")
                {
                    sOrderString += " DESC ";
                }
                else
                {
                    sOrderString += " ASC ";
                }
            }
            sFilter = " 1=1 " + sFilter; 
            string strSql = "SELECT ID0,案件编号,案件名称,流程ID,活动ID,承办人ID,承办意见,承办时间,延迟时间,流水号,备注,历史标志,现状标志,案件状态,已办事件,保留字段1,保留字段2,母流程入口ID0,主承办人,工作所花时间,PRESTEP,STATES,IP,督办ID,移交方向,分组ID,时限,办结时间,会办标志,决定异常,收费异常,DECIDEINFO FROM LANDFLOWGLOB t WHERE " + sFilter + sOrderString;
            if (iPageSize > 0)
            {
                strSql = iDb.GetSqlForPageSize("LANDFLOWGLOB", "ID0", iPageSize, iPageIndex, sFilter, sOrderString);
            }
            DataSet ds = iDb.GetDataSet(strSql);
            sr.TableResult = ds;
            return sr;
        }
    }
}